<template>
	<view>
		<sqlite-manage :dbName="dbName" :tableSqls="tableSqls"></sqlite-manage>
	</view>
</template>

<script>
	// 导入可视化页面组件
	import sqliteManage from '@/uni_modules/zjy-sqlite-manage/components/zjy-sqlite-manage/zjy-sqlite-manage.vue'

	export default {
		components: {
			sqliteManage
		},
		data() {
			return {
				title: 'Hello',
				//数据库名称
				dbName: 'testDb',
				//初始化的表
				tableSqls: [{
					tableName: 'user',
					sql: `CREATE TABLE "user" (
						  "id" text NOT NULL,
						  "name" TEXT NOT NULL, --名称
						  "createTime" DATE, --创建时间
						  "remark" TEXT, --描述
						  PRIMARY KEY ("id") --主键
						);`
				}, {
					tableName: 'hobby',
					sql: `CREATE TABLE "hobby" (
						  "id" text NOT NULL, --ID
						  "userId" text, --用户ID
						  "hobby" text, --爱好
						  "createTime" DATE, --创建时间
						  "remark" TEXT, --描述
						  PRIMARY KEY ("id") --主键
						);`
				}]
			}
		},
	}
</script>
<style>
</style>
